/*
 * Copyright 2000-2025 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
 */

package com.jetbrains.plugin.structure.classes.resolvers

const val UNNAMED_RESOLVER = "Unnamed Resolver"
val EMPTY_RESOLVER = EmptyResolver(UNNAMED_RESOLVER)

fun List<NamedResolver>?.asResolver(name: String): NamedResolver {
  return if (this == null || isEmpty()) {
    EmptyResolver(name)
  } else {
    LazyCompositeResolver.create(this, name)
  }
}
